Git Terminology and Notes

a. Version Control Software

Version control software is a tool that tracks changes to files over time, allowing multiple people to work on the same project without overwriting each other’s work. It keeps a history of every change so you can review, revert, or compare versions.

git version

b. Add

In Git, “add” iso the command that stages changes you’ve made to files so they are ready to be committed.

git add index.php

c. Commit

A commit is a saved snapshot of your project at a specific point in time. It includes all staged changes and a message describing what was changed, it can also be revisited in the history. This is essentially the “save” button.

git commit -m "Added homepage layout"

d. Push

This sends your local commits to your remote repository in GitHub.

git push origin main

e. Pull

This updates your local repository with the latest changes from your remote repository.

git pull origin main

f. Clone

This creates a local copy of a remote repository on your computer. This is essentially the “copy” button.

git clone https://github.com/tdr453/WDV341.git

Example Git Commands

1. Check your Git version
git --version

2. Clone the repository to your computer
git clone https://github.com/tdr453/WDV341.git

3. Navigate into the repository folder
cd C:\xampp\htdocs\WDV341

4. Stage (add) the file for commit
git add Git_Terminology.php

5. Commit the staged changes with a message
git commit -m "Add or update Git_Terminology.php"

6. Push your commits to GitHub
git push origin main

7. Pull the latest changes from GitHub
git pull origin main

8. Check the status of your repository
git status

9. View the commit history
git log